// Rectangle class - Rectangle element for scene - draws and manages a Rectangle in the scene
ResponsiveRectangle.prototype = new Rectangle();  
ResponsiveRectangle.prototype.constructor=ResponsiveRectangle;
function ResponsiveRectangle(x,y, w, h){
	this.percentagePosition = {x:x,y:y,w:w,h:h};
	
	this.addedToScene = function(scene){		
		scene.domUtils.addEventSimple(scene.canvas,"onresize", this.updateRectangle);
		this.updateRectangle();
	}
	this.updateRectangle = function(){
		if(!this.scene)return;
		var sceneSize = scene.getSize();
		this.x = sceneSize.w * this.percentagePosition.x / 100;
		this.y = sceneSize.h * this.percentagePosition.y / 100;
		this.w = sceneSize.w * this.percentagePosition.w / 100;
		this.h = sceneSize.h * this.percentagePosition.h / 100;
		this.updateBoundary();
	}
}
